From: Florian Müllner Date: Tue, 26 Jun 2012 15:44:24 +0000 (+0200) Subject: Fix wrong result handling of remote calls X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6413 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ae16da4e8168f99140641ef90c99c18af3609870;p=gnome-shell.git Fix wrong result handling of remote calls When using dbus-glib, single return values were special-cased to be returned verbatim rather than as array with a single element. This is no longer true since switching to GDBus, so fix the places where the change was overlooked. https://bugzilla.gnome.org/show_bug.cgi?id=678852 --- diff --git a/js/gdm/powerMenu.js b/js/gdm/powerMenu.js index 3804ec568..613a89607 100644 --- a/js/gdm/powerMenu.js +++ b/js/gdm/powerMenu.js @@ -70,7 +70,7 @@ const PowerMenuButton = new Lang.Class({ this._systemdLoginManager.CanPowerOffRemote(Lang.bind(this, function(result, error) { if (!error) - this._haveShutdown = result != 'no'; + this._haveShutdown = result[0] != 'no'; else this._haveShutdown = false; @@ -81,7 +81,7 @@ const PowerMenuButton = new Lang.Class({ this._consoleKitManager.CanStopRemote(Lang.bind(this, function(result, error) { if (!error) - this._haveShutdown = result; + this._haveShutdown = result[0]; else this._haveShutdown = false; @@ -97,7 +97,7 @@ const PowerMenuButton = new Lang.Class({ this._systemdLoginManager.CanRebootRemote(Lang.bind(this, function(result, error) { if (!error) - this._haveRestart = result != 'no'; + this._haveRestart = result[0] != 'no'; else this._haveRestart = false; @@ -108,7 +108,7 @@ const PowerMenuButton = new Lang.Class({ this._consoleKitManager.CanRestartRemote(Lang.bind(this, function(result, error) { if (!error) - this._haveRestart = result; + this._haveRestart = result[0]; else this._haveRestart = false; diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js index 8e9c3e703..41bf99889 100644 --- a/js/ui/userMenu.js +++ b/js/ui/userMenu.js @@ -584,7 +584,7 @@ const UserMenuButton = new Lang.Class({ this._session.CanShutdownRemote(Lang.bind(this, function(result, error) { if (!error) { - this._haveShutdown = result; + this._haveShutdown = result[0]; this._updateSuspendOrPowerOff(); } }));